{% load filter %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .condition a{
            display: inline-block;
            padding: 3px 5px;
            border: 1px solid greenyellow;
            margin: 5px 5px;
        }
        .active {
            background-color: green;
        }
    </style>
</head>
<body>
<h1>过滤条件</h1>
<div class="condition">
    <div>
        {% filter_all url_info 'article_type_id'%}
{#        <a href="/article-0-{{ url_info.category_id }}">全部</a>#}
        {% filter_article_type type_list url_info %}
{#        {% for type in type_list %}#}
{#            {% if url_info.article_type_id == type.id %}#}
{#                <a class="active" href="/article-{{ type.id }}-{{ url_info.category_id }}">{{ type.caption }}</a>#}
{#            {% else %}#}
{#                <a href="/article-{{ type.id }}-{{ url_info.category_id }}">{{ type.caption }}</a>#}
{#            {% endif %}#}
{#        {% endfor %}#}
    </div>

    <div>
        {% filter_all url_info 'category_id'%}
{#        <a href="/article-{{ url_info.article_type_id }}-0">全部</a>#}
        {% for cate in cate_list %}
            {% if url_info.category_id == cate.id %}
                <a class="active" href="/article-{{ url_info.article_type_id }}-{{ cate.id }}">{{ cate.caption }}</a>
            {% else %}
            <a href="/article-{{ url_info.article_type_id }}-{{ cate.id }}">{{ cate.caption }}</a>
            {% endif %}
        {% endfor %}
    </div>


</div>
<h1>查询结果</h1>
<ul>
    {% for foo in result %}
        <li>{{ foo.title }}</li>
        {{ foo.content }}
    {% endfor %}
</ul>
</body>
</html>